package com.alpha.eceasy.mall.controller.inner;

import com.alpha.eceasy.mall.api.dto.MallCommodityDTO;
import com.alpha.eceasy.core.R;

import com.alpha.eceasy.mall.service.MallCommodityService;
import io.swagger.v3.oas.annotations.Hidden;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Operation;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.*;

/**
 * 商品与关系表
 *
 * @author huangpengfei
 * @since 2022-02-11 16:55:59
 */
@RestController
//@Inner
@Hidden
@RequestMapping("/inner/commodity")
@Tag(description = "commodity", name = "商品与关系表")
public class MallCommodityInnerController {
    @Resource
    private MallCommodityService mallCommodityService;

    @Operation(description = "新增完整单个商品", summary = "新增完整单个商品")
    //@SysLog("新增完整单个商品")
    @PostMapping("/complete-for-commodity")
    public R<String> createCommodity(@RequestBody MallCommodityDTO dto) {
        return R.ok(mallCommodityService.save(dto));
    }
}
